package com.lineage.data.event;

import com.lineage.data.executor.EventExecutor;
import com.lineage.server.datatables.lock.CharItemPowerReading;
import com.lineage.server.templates.L1Event;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

public class PowerItemSet extends EventExecutor {
  private static final Log _log = LogFactory.getLog(PowerItemSet.class);
  
  public static boolean START = false;
  
  public static int HOLER = 0;
  
  public static int ARMORHOLE = 0;
  
  public static int WEAPONHOLE = 0;
  
  public static EventExecutor get() {
    return new PowerItemSet();
  }
  
  public void execute(L1Event event) {
    try {
      START = true;
      String[] set = event.get_eventother().split(",");
      HOLER = Integer.parseInt(set[0]);
      ARMORHOLE = Integer.parseInt(set[1]);
      if (ARMORHOLE > 5)
        ARMORHOLE = 5; 
      WEAPONHOLE = Integer.parseInt(set[2]);
      if (WEAPONHOLE > 5)
        WEAPONHOLE = 5; 
      CharItemPowerReading.get().load();
    } catch (Exception e) {
      _log.error(e.getLocalizedMessage(), e);
    } 
  }
}
